﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HierarchicalClustering.LinkageCriteria
{
    public class LinkageFactory   // creates linkage criteria
    {
        public static ILinkage GetLinkage(string linkage)
        {   // gets linkage criteria by name
            if (linkage == "Minimum or single-linkage clustering")
                return new Min();
            else if (linkage == "Maximum or complete linkage clustering")
                return new Max();
            else if (linkage == "Mean or average linkage clustering")
                return new Average();
            else
                return null;
        }

        public static IEnumerable<string> GetLinkageNames()
        {   // get linkage criteria names
            yield return "Minimum or single-linkage clustering";
            yield return "Maximum or complete linkage clustering";
            yield return "Mean or average linkage clustering";
            yield break;
        }
    }
}
